/**
 * 
 */
package com.kovell.profileo.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author SOSSERES
 *
 */
@Entity
@Table(name="PFO_USER")
public class UserEntity extends BaseEntity{

	@Column(name="LOGIN", unique=true, nullable=false)
	private String login;
	
	@Column(name="PASSWORD", nullable=false)
	private String password;
	
	@Column(name="LAST_NAME", nullable=false)
	private String lastName;
	
	@Column(name="LAST_LOGIN")
	@Temporal(TemporalType.TIMESTAMP)
	private Date lastLogin;
	
	@Column(name="SESSION_ID")
	private String sessionId;
	
	@Column(name="FIRST_LOGIN")
	@Temporal(TemporalType.TIMESTAMP)
	private Date firstLogin;
	
	@Column(name="USR_STAT")
	private String status;
	
	@Column(name="MODIFICATION_NUM")
	private Integer modification;
	
	/**
	 * 
	 */
	public UserEntity() {
		// TODO Auto-generated constructor stub
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public Date getLastLogin() {
		return lastLogin;
	}

	public void setLastLogin(Date lastLogin) {
		this.lastLogin = lastLogin;
	}

	public Date getFirstLogin() {
		return firstLogin;
	}

	public void setFirstLogin(Date firstLogin) {
		this.firstLogin = firstLogin;
	}

	public String getSessionId() {
		return sessionId;
	}

	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}
	
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public int getModification() {
		return modification;
	}

	public void setModification(int modification) {
		this.modification = modification;
	}
	
	public void setModify(String modifiedBy, Date modified){
		setModified(modified);
		setModifiedBy(modifiedBy);
		this.modification+=1;
	}
	
}
